﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace Utilities
{
    /// <summary>
    /// Bazowa klasa dla testow zgodna z AAA
    /// </summary>
    [TestFixture]
    public abstract class observations_for_sut<T>
    {
        protected T Sut;

        [SetUp]
        public void Setup()
        {
            EstablishContext();
            Because();
        }

        /// <summary>
        /// Wywolywana po kazdym tescie
        /// </summary>
        protected virtual void AfterEachObservation()
        {
        }

        [TearDown]
        private void TearDown()
        {
            AfterEachObservation();
        }

        /// <summary>
        /// Przeprowadz test (Act)
        /// </summary>
        protected abstract void Because();

        /// <summary>
        /// Przygotuwuje rodowisko do testowania (Arrange)
        /// </summary>
        protected virtual void EstablishContext()
        {
        }

    }
}
